/**
 * @file cm_video_ctrl.c
 * @author jmdvirus
 */

#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include "cm_video_ctrl.h"

static const CMVideoImpl *cm_video_impl_list[] = {
    &cm_video_impl_v4l2,
    NULL,
};

const CMVideoImpl *cm_video_impl_find(const char *type)
{
    CMVideoImpl *impl = NULL;
    int          i    = 0;
    while ((impl = (CMVideoImpl *)cm_video_impl_list[i++]) != NULL)
    {
        if (strlen(impl->name) == strlen(type) && strcmp(impl->name, type) == 0)
        {
            return impl;
        }
    }
    return NULL;
}
